package com.tedu.openmedical.caseInfo.controller;

import com.tedu.openmedical.base.response.JsonResult;
import com.tedu.openmedical.caseInfo.pojo.dto.CaseQuery;

import com.tedu.openmedical.caseInfo.pojo.vo.CaseVo;
import com.tedu.openmedical.caseInfo.service.CaseService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/v1/hospitalization/case/")
@Api(tags = "病案管理")
@Slf4j
public class CaseController {
    @Autowired
    CaseService caseService;
    @GetMapping("select")
    @ApiOperation(value = "查询病案信息")
    public JsonResult getCaseInfo(CaseQuery caseQuery) {
        log.debug("查询患者信息：caseQuery={}",caseQuery);
        List<CaseVo> caseInfo = caseService.select(caseQuery);
        return JsonResult.ok(caseInfo);
    }
}
